resource "alicloud_vpc" "vpc" {
  vpc_name        = "${var.vpc_name}-vpc"
  cidr_block      = var.vpc_cidr
  description     = var.vpc_description
}

# data "alicloud_zones" "main" {
# }

# resource "alicloud_vswitch" "vswitch" {
#   vpc_id            = alicloud_vpc.vpc.id

#   count             = length(var.vswitch_cidr)
#   cidr_block        = var.vswitch_cidr[count.index]
#   zone_id           = data.alicloud_zones.main.zones[format(
#     "%d",
#     length(data.alicloud_zones.main.zones) < 2 ? 0 : count.index % length(data.alicloud_zones.main.zones),
#   )]["id"]
#   vswitch_name      = "${var.vswitch_name}-${data.alicloud_zones.main.zones[format(
#     "%d",
#     length(data.alicloud_zones.main.zones) < 2 ? 0 : count.index % length(data.alicloud_zones.main.zones),
#   )]["id"]}"
# }


